// svg图标组件
import SvgIcon from '@/components/SvgIcon/index.vue'
// 三级分类组件
import Category from '@/components/Category/index.vue'
// 导入所有图标 element-plus
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 全局组件对象,方便遍历注册
const globalComponent: any = { SvgIcon, Category }
export default {
  // 自定义插件,该方法会被自动执行,并且注入
  install(app: any) {
    Object.keys(globalComponent).forEach(key => {
      app.component(key, globalComponent[key])
    })
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
